<?php
  session_start();
   if (isset($_SESSION['usr']))
   {
      echo "logged: ",$_SESSION['usr']," <a href='logout.php'>Logout</a>
      ";
      echo "<br />
      ";
      echo "<a href='edit.php?uid=", $_SESSION['uid'], "'>Edit</a> my photoalbum";
   }
   else
   {
?>   
<form method="post" action="logincheck.php" enctype="multipart/form-data">
<table border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td>Username:</td>
    <td><input type="text" name="usr" /></td>
  </tr>
  <tr>
    <td>Password:</td>
    <td><input type="password" name="pass" /></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="submit" value="L O G I N" /></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><a href="register.php">Registration</a></td>
  </tr>
</table>
</form>

<?php
    }
?>
